package rune;

import java.util.List;

import rune.effect.EffectType;
import rune.effect.EffectVariation;
import rune.effect.RuneEffect;

/**
 * 
 * @author Miky
 * @version $Id: Rune.java 25 2013-04-06 23:09:20Z mikael.beyene $
 */
public class Rune {

	private final String name;
	private final RuneType type;
	private final RuneClass clazz;
	private final List<RuneEffect> effect;
	private final int price;

	public Rune(String name, RuneType type, RuneClass clazz,
			List<RuneEffect> effect, int price) {
		this.name = name;
		this.type = type;
		this.clazz = clazz;
		this.effect = effect;
		this.price = price;
	}

	public String getName() {
		return name;
	}

	public RuneType getType() {
		return type;
	}

	public RuneClass getClazz() {
		return clazz;
	}

	public List<RuneEffect> getEffect() {
		return effect;
	}
	
	public int getPrice() {
		return price;
	}

	public boolean hasEffecType(EffectType compare) {
		boolean found = false;

		for (RuneEffect e : effect) {
			if (e.getType() == compare) {
				found = true;
				break;
			}
		}
		return found;
	}

	public boolean hasEffectVariation(EffectVariation compare) {
		boolean found = false;

		for (RuneEffect e : effect) {
			if (e.getVariation() == compare) {
				found = true;
				break;
			}
		}
		return found;
	}
}
